home *** CD-ROM | disk | FTP | other *** search
/ PC Creation 3 / PCCREATION3.iso / Pc_creation / somm.dxr / 00004_recadrage image.ls < prev    next >
Encoding:
Text File  |  2001-12-13  |  1.8 KB  |  38 lines

  1. on resize NumDuSprite, NumDuMember, X, Y
  2.   global DoitReadapterTailleImage, tailleorigin, comptetour, choix, theme, types, listefichier, images, jpg
  3.   taille_origine(X, Y, NumDuMember)
  4.   if (DoitReadapterTailleImage = 1) and ((getAt(tailleorigin, 1) > X) or (getAt(tailleorigin, 2) > Y)) then
  5.     compteclic = 0
  6.     set the floatPrecision to 2
  7.     if (float(X) / float(getAt(tailleorigin, 1))) < (float(Y) / float(getAt(tailleorigin, 2))) then
  8.       prctplusreduit = float(X) / float(getAt(tailleorigin, 1)) * 100
  9.       set the height of sprite NumDuSprite to float(getAt(tailleorigin, 2)) * float(prctplusreduit) / 100
  10.       set the width of sprite NumDuSprite to float(getAt(tailleorigin, 1)) * float(prctplusreduit) / 100
  11.     else
  12.       prctplusreduit = float(Y) / float(getAt(tailleorigin, 2)) * 100
  13.       set the width of sprite NumDuSprite to float(getAt(tailleorigin, 1)) * float(prctplusreduit) / 100
  14.       set the height of sprite NumDuSprite to float(getAt(tailleorigin, 2)) * float(prctplusreduit) / 100
  15.     end if
  16.   else
  17.     if (DoitReadapterTailleImage = 1) and ((the width of sprite NumDuSprite > X) or (the height of sprite NumDuSprite > Y)) then
  18.       compteclic = 0
  19.       set the width of sprite NumDuSprite to getAt(tailleorigin, 1)
  20.       set the height of sprite NumDuSprite to getAt(tailleorigin, 2)
  21.     else
  22.       set the width of sprite NumDuSprite to getAt(tailleorigin, 1)
  23.       set the height of sprite NumDuSprite to getAt(tailleorigin, 2)
  24.     end if
  25.   end if
  26.   updateStage()
  27. end
  28.  
  29. on taille_origine X, Y, NumDuMember
  30.   global tailleorigin, DoitReadapterTailleImage
  31.   tailleorigin = list(member(NumDuMember).width, member(NumDuMember).height)
  32.   if (getAt(tailleorigin, 1) > X) or (getAt(tailleorigin, 2) > Y) then
  33.     DoitReadapterTailleImage = 1
  34.   else
  35.     DoitReadapterTailleImage = 0
  36.   end if
  37. end
  38.